package com.itcast.listener;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class FanoutListener {
    @RabbitListener(queues = "fanoutQueue1")
    public void consumer1(String msg) {
        System.out.println("消费者1接受队列1的消息是：" + msg);
    }

    //声明消费者2
    @RabbitListener(queues = "fanoutQueue2")
    public void consumer2(String msg) {
        System.out.println("消费者2接受队列2的消息是：" + msg);
    }
}
